package oa.hleast.xswl.common.enums;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum PointOperatingEnum {
    /**
     * 签到
     */
    SIGN(1, "签到", 1),
    /**
     * AR红包
     */
    AR(2, "AR红包", 1),
    /**
     * 商品兑换
     */
    PRODUCT_EXCHANGE(3, "商品兑换", 2),
    /**
     * 优惠券兑换
     */
    COUPON_EXCHANGE(4, "优惠券兑换", 2),
    /**
     * 积分抽奖消费
     */
    POINT_LOTTERY_DRAW(5, "积分抽奖消费", 2),
    /**
     * 积分抽奖获奖
     */
    POINT_LOTTERY_LUCKY(6, "积分抽奖获奖", 1),
    /**
     * 赏花打卡
     */
    FLOWER_CLOCK_IN(7, "赏花打卡", 1);

    private Integer code;
    private String name;
    @ApiModelProperty("1: + 2: -")
    private Integer pointType;

    public static PointOperatingEnum getValue(Integer code) {
        for (PointOperatingEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
